import mysql from 'mysql'
const pool = mysql.createPool({
    host: '169.254.90.111',
    // host: 'localhost',
    user: 'root',
    prot:'3306',
    password: 'rootroot',
    database: "fish_cool"
})

export default function sqlQuery(sqlstr){
    return new Promise((resolve,reject)=>{
        pool.getConnection((err,connect)=>{
            if(err){
                reject(err)
            }else{
                connect.query(sqlstr,(err,result)=>{
                    if(err) reject(err);
                    else resolve(result)
                })
                connect.release()
            }
        })
    })
}